import { formatTimestamp } from '@/utils/format'
import { getTextByCode } from '../utils/getTextByCode'
import { SETTLE_STATUS } from './settleStatus'
import { formatMoney } from '@/utils/util'

export const BATCH_PAY_TYPE = {
  10: '线上支付',
  20: '线下支付'
}
export const SETTLEMENT_LIST_COLUMNS = [
  {
    title: '订单ID',
    dataIndex: 'settleOrderId',
    fixed: 'left'
  },
  {
    title: '子订单ID',
    dataIndex: 'childrenOrderId',
    fixed: 'left'
  },
  {
    title: '姓名',
    dataIndex: 'name'
  },
  {
    title: '手机号',
    dataIndex: 'phone'
  },
  {
    title: '身份证号',
    dataIndex: 'idcardNum'
  },
  {
    title: '开户行',
    dataIndex: 'bankName'
  },
  {
    title: '银行卡号',
    dataIndex: 'bankCardNum'
  },
  {
    title: '众包费',
    dataIndex: 'salaryFee',
    customRender: salaryFee => formatMoney(salaryFee),
    customExportRender: salaryFee => formatMoney(salaryFee).substring(2)
  },
  {
    title: '服务费',
    dataIndex: 'manageFee',
    customRender: manageFee => formatMoney(manageFee),
    customExportRender: manageFee => formatMoney(manageFee).substring(2)
  },
  {
    title: '支付方式',
    dataIndex: 'payType',
    customRender: type => getTextByCode(type, BATCH_PAY_TYPE)
  },
  {
    title: '结算状态',
    dataIndex: 'settleStatus',
    customRender: status => getTextByCode(status, SETTLE_STATUS)
  },
  {
    title: '创建时间',
    dataIndex: 'payTime',
    customRender: (date) => formatTimestamp(date)
  }
  // {
  //   title: '操作',
  //   dataIndex: 'action',
  //   width: '150px',
  //   scopedSlots: { customRender: 'action' },
  //   fixed: 'right'
  // }
]
